
<center><div id="message">&nbsp;</div></center>
<div style="clear:both;height:25px"></div>
<?php if($this->Session->read('message')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('message').'");</script>';
	$this->Session->delete('message');	
	}?>
<?php if($this->Session->read('error')){
	echo '<script>showMessage("mainContent","'.$this->Session->read('error').'",1);</script>';
	$this->Session->delete('error');
}?>
	<form id="listForm" name="listForm" method="get" action="#">
    <table class="list">
      <tbody>
      <tr>
      	<th align="center" width="10px">#</th>
      	<th align="center" width="10px"><input class="checkbox"  type="checkbox" name="all" value="" onclick="checka('listForm');" />
        <th align="left" width="140px"><?php _resource('image')?></th>
        <th align="left"><?php echo $this->Common->columnTitle(_resource('title',true),'I18n__title.content',$pid,$uses[0])?></th>
        <th align="left"><?php _resource('link thumb')?></th>
        
        <th align="left"><?php _resource('link image')?></th>
        <th align="center" width="80px"><?php echo $this->Common->columnTitle(_resource('status',true),$uses[0].'.published',$pid)?></th>        
        
        
        <?php if($webConfig['is_multi_lang']){?>
        <th align="center" width="150px"><?php _resource('languages');?></th>
        <?php }?>
        <th align="center" width="100px"><?php _resource('task');?></th>
      </tr>
		<?php
			if(count($data0)>0){
			foreach($data0 as $k=>$v){
		?>
      <tr class="row<?php echo fmod($k,2)+1;?>" onmouseout="this.className='row<?php echo fmod($k,2)+1;?>'" onmouseover="this.className='highlight'">
      	<td align="center"><?php echo $this->Session->read($uses[0].'.limit')*($this->params['paging'][$uses[0]]['page']-1)+$k+1;?>
      	<td align="center"><input class="checkbox" type="checkbox" id="cb" name="check[<?php echo $v[$uses[0]]['id'];?>]"/>
        <td align="left">
        	<a href="javascript:;" onclick="deactivateEditors();ajax('addContent','<?php echo $this->params['controller'].'/edit/'.$v[$uses[0]]['id'].'/'.$pid;?>');" >
			<?php 
        	if(!empty($v[$uses[0]]['image']))$src=$this->webroot.'uploaded/'.$uses[0].'/thumb/'.$v[$uses[0]]['image'];
        	else $src=$this->webroot.'img/backend/thumb_noimg.jpg';
        	echo '<img src="'.$src.'" />'?>
        	</a>
        </td>
        <td align="left"><a href="javascript:;" onclick="deactivateEditors();ajax('addContent','<?php echo $this->params['controller'].'/edit/'.$v[$uses[0]]['id'].'/'.$pid;?>');" ><?php echo $v[$uses[0]]['title'];?></a></td>
                   <td align="left"><a target="_blank" href="<?php echo SITE_URL.'/uploaded/Image/thumb/'.$v[$uses[0]]['image']?>"> <?php echo _resource("link thumb")?></a> </td>
                   
                   <td align="left"><a target="_blank" href="<?php echo SITE_URL.'/uploaded/Image/image/'.$v[$uses[0]]['image']?>"> <?php echo  _resource("link image")?></a> </td>
        <!--published -->
              <td align="center">
              	<div id="published_<?php echo $v[$uses[0]]['id']?>" >
              
                  <?php 
						if($v[$uses[0]]['published']){
							echo '
							<span title="'._resource('published',true).'">
					<a href="javascript:;">
							<img src="'.$this->webroot.'img/backend/tick.png'.'" width="16" height="16" border="0" alt="'._resource('published',true).'" onclick="ajax(\'published_'.$v[$uses[0]]['id'].'\',\''.$this->params['controller'].'/published/'.$v[$uses[0]]['id'].'/0\');" /></a></span>';
						}
						else{
							echo '
							<span title="'._resource('unpublished',true).'">
					<a href="javascript:;">
							<img src="'.$this->webroot.'img/backend/publish_x.png'.'" width="16" height="16" border="0" alt="'._resource('unpublished',true).'" onclick="ajax(\'published_'.$v[$uses[0]]['id'].'\',\''.$this->params['controller'].'/published/'.$v[$uses[0]]['id'].'/1\');" /></a></span>';
						}
						?>
                	</div>
                </td>
                
        <!--Language -->
		<?php if($webConfig['is_multi_lang']) {?>
        <td align="center"><?php 
			foreach(explode(',',$webConfig['langs']) as $value)
				if(!empty($v['Langs']) && in_array($value,$v['Langs'])){
					echo '<img style="cursor:pointer;" onclick="deactivateEditors();ajax(\'addContent\',\''.$this->params['controller'].'/edit/'.$v[$uses[0]]['id'].'/'.$pid.'/'.$value.'\');" class="Tips1" title="'.$listLang[$value].'" 
					border="0" src="'.$this->webroot.'img/backend/flag/'.$value.'.png'.'">&nbsp;&nbsp;';
				}
				else{
					echo '<img style="cursor:pointer;opacity:0.2;filter:alpha(opacity=20);" 
					onmouseover="if(document.all){this.filters.alpha.opacity=100;}else{this.style.MozOpacity=1;}"
					onmouseout="if(document.all){this.filters.alpha.opacity=20;}else{this.style.MozOpacity=0.2;}"					
					onclick="deactivateEditors();ajax(\'addContent\',\''.$this->params['controller'].'/edit/'.$v[$uses[0]]['id'].'/'.$pid.'/'.$value.'\');" class="Tips1" title="'.$listLang[$value].'" 
					border="0" src="'.$this->webroot.'img/backend/flag/'.$value.'.png'.'">&nbsp;&nbsp;';
				}
			?>
        </td>         
		<?php }?>
        <td align="center">
		<span title="<?php _resource('edit');?>"><a href="javascript:;" onclick="deactivateEditors();ajax('addContent','<?php echo $this->params['controller'].'/edit/'.$v[$uses[0]]['id'].'/'.$pid;?>');"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-edit.png"/></a></span>
		<span title="<?php _resource('delete');?>"><a href="javascript:;" onclick="ajaxSubmit('listContent','<?php echo $this->params['controller'].'/delete/'.$pid.'/'.$v[$uses[0]]['id'];?>','deleteone','',true);return false;"> <img border="0" src="<?php echo $this->webroot; ?>img/backend/icon-16-trash.png"/></a></span>
	</td>
      </tr>
      <?php } ?>
      <?php } ?>
      
          </tbody>
      </table>
</form>

<div class="pagination">
                <span><?php _resource('display') ?> #
                  <select name="limit" id="limit" class="inputbox" size="1" onchange="ajax('listContent','<?php echo $this->params['controller']?>/display/'+this.value+'/<?php echo $pid?>');">
                    <?php 
							for($i=1;$i<10;$i++){
								$v=$i*$webConfig['default_row_per_page'];
								$select=($this->Session->read($uses[0].'.limit')==$v)?'selected="selected"':'';
								echo '<option value="'.$v.'" '.$select.' >'.$v.'</option>';
							}
						?>
                  </select>
                </span>
                <!-- Button prev -->
           
                <?php
                	$paging=$this->Paginator->getPages(); 
							if(isset($paging['prev'])){
								echo $paging['prev'];
							}
							
							
						?>
                <!-- end Button prev -->
                
                    <?php
                    	echo $paging['paging'];
					?>
                  
                <!-- Button next -->
                
                <?php 
							if(isset($paging['next'])){
								echo $paging['next'];
							}
							
						?>
                <!-- end Button next -->
                <span>
                  <?php if(!empty($paging['cboPaging'])){
								echo _resource('goto',true).' # '.$paging['cboPaging'];
							}?>
                </span>
                <span>
                  <?php
								if($paging['totalPage']>0){
								?>
                  Page <?php echo $paging['currentPage']?>/<?php echo $paging['totalPage']?> </span>
                <?php
								}
								?>
                
</div>
<?php echo $this->element('sql_dump'); ?>